<template>
	<view class="content">
		<view class="item">
			 <text class="newsTime">{{ $formatDateString(data.created_at) }}</text>
			<view class="line1"></view>
			<text class="projectTitle">{{data.name}}</text>
			<text class="newsTitle">{{data.title}}</text>
			<view class="line2"></view>
			<mp-html :content="data.content" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:'',
				id:''
			}
		},
		onShow(options) {
			let pagearr = getCurrentPages();
			let currentPage = pagearr[pagearr.length - 1];
			this.id = currentPage.options.id;
			this.$request.get(`articleRead/${this.id}`).then(res => {
				this.data = res.data.data;
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.item {
		width: 670rpx;
		padding-left: 40rpx;
		padding-right: 40rpx;
		margin-top: 60rpx;
		padding-bottom: 100rpx;
		border-bottom: 1rpx solid #dbdbdb;
		position: relative;
		display: flex;
		flex-direction: column;

		.infoBtn {
			position: absolute;
			right: 40rpx;
			bottom: 60rpx;
			width: 150rpx;
			height: 60rpx;
			line-height: 60rpx;
			text-align: center;
			border-radius: 30rpx;
			background: #121212;
			font-weight: 500;
			font-size: 16rpx;
			color: #FFFFFF;
			letter-spacing: 2rpx;
		}


		.newsTitle {
			margin-top: 10rpx;
			color: #121212;
			font-weight: 900;
			font-size: 26rpx;
		}
		.projectTitle{
			margin-top: 30rpx;
			color: #121212;
			font-weight: 900;
			font-size: 26rpx;
		}
		.line2 {
			margin-top: 70rpx;
			margin-bottom: 70rpx;
			width: 100%;
			height: 1rpx;
			background: #dbdbdb;
		}

		.line1 {
			margin-top: 30rpx;
			width: 18rpx;
			height: 4rpx;
			background: #ff6e5d;
		}

		.newsTime {
			margin-top: 50rpx;
			font-weight: 700;
			font-size: 42rpx;
			color: #121212;

		}

		.poster {
			width: 100%;
			height: 420rpx;
		}
	}

	.item:last-child {
		border: none;
	}

	.content {
		width: 100%;
		height: 100%;
	}
</style>